{extend name="layouts/main" /}
{block name="content"}
<div class="layui-body" style="top: 0px;left: 0px;">
	<!-- 内容主体区域 -->
	<div class="layui-fluid" style="position: relative;margin: 0 auto;padding: 7px;padding-top: 0px;">
		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
			<!-- 字段分组，基础设置和拓展设置 -->
			<ul class="layui-tab-title">
				{if condition="$fields"}
					{volist name="$fields" id="list"}
					<li {eq name="key" value="1"}class="layui-this"{/eq}>{:get_field_group($key)}</li>
					{/volist}
				{/if}
			</ul>
			<div class="layui-tab-content layui-setting form-horizontal">
				{if condition="$fields"}
				{volist name="$fields" id="list"}
				<div class="layui-tab-item {eq name="key" value="1"}layui-show{/eq}">
					<form class="layui-form layui-form-pane" action="{:url('add')}">
						{if condition="$form eq 0"}
						<!-- 栏目名称，展示并非字段之内-->
						<div class="layui-form-item">
							<label class="layui-form-label">栏目名称</label>
							<div class="layui-input-block">
								<input type="text" disabled="disabled" value="{:get_Category_title($info['category_id'])}" placeholder="" autocomplete="off" class="layui-input">
								<span class="layui-form-mid layui-word-aux">
									[ 文章所属栏目 ]
								</span>
								<span class="sysval"><em class="zerocopy">typename</em></span>
							</div>
						</div>
						{/if}
						{volist name="list" id="field"}
						{if condition="($field['is_show'] == 1 || $field['is_show'] == 2) AND $field['status'] ==1"}
						{php} echo \think\Response::create('admin@layouts/inputitem', 'view')->assign('field', $field)->getContent(); {/php}
						{/if}
						{/volist}
						<div class="layui-form-item">
							<div class="layui-input-inline" style="padding-left: 142px;width: 320px;">
								<!-- <button  class="layui-btn x_admin_close ajax-post2" type="submit" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button> -->
								<!-- 防止回车提交 -->
								<button class="layui-btn x_admin_close ajax-post2" type="button" target-form="form-horizontal" lay-submit lay-filter="demo1">提交保存</button>
								<button type="reset" class="layui-btn layui-btn-primary">重置</button>
								<!-- <button type="button" onclick="javascript:history.back(-1);return false;" class="layui-btn layui-btn-primary">返回</button> -->
							</div>
						</div>
					</form>
				</div>
				{/volist}
				{/if}
				<input type="hidden" name="model_id" value="{$info.model_id|default=''}" class="upload-text"/>
				<input type="hidden" name="category_id" value="{$info.category_id|default=''}" class="upload-text">
			</div>
		</div>
	</div>
</div>
{/block}
{block name="footer"}
{/block}
{block name="js"}
<script type="text/javascript">
	// 是否截取到内容摘要、是否提取到缩略图
	layui.use(['form'], function() {
		var form = layui.form;
		$(".content_attr").append("<input type='checkbox' name='get_introduce' value='1' title='是否截取到内容摘要' checked class='upload-checkbox'> <input type='checkbox' name='auto_thumb' value='1' title='是否提取到缩略图' checked class='upload-checkbox'>");
		form.render();
	});
</script>
{/block}